package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2019/1/21 10:06
 * @description
 */
public class Code796 {
    public boolean rotateString(String A, String B) {
        if (A.length() < 2) {
            return A.equals(B);
        }
        for (int i = 0; i < B.length() - 1; i++) {
            A = A.substring(1) + A.charAt(0);
            if (A.equals(B)) {
                return true;
            }
        }
        return false;
    }
}
